package com.hzncc.flowable_diboot.service.bpm;

import com.diboot.core.service.BaseService;
import com.diboot.core.vo.Pagination;
import com.hzncc.flowable_diboot.dto.bpm.BpmModelMetaInfoRespDTO;
import com.hzncc.flowable_diboot.entity.FormDesign;
import com.hzncc.flowable_diboot.entity.bpm.BpmCategory;
import com.hzncc.flowable_diboot.entity.bpm.BpmForm;
import com.hzncc.flowable_diboot.entity.bpm.BpmProcessDefinitionInfo;
import com.hzncc.flowable_diboot.vo.bpm.BpmProcessDefinitionReqVO;
import com.hzncc.flowable_diboot.vo.bpm.BpmProcessDefinitionRespVO;
import com.hzncc.flowable_diboot.vo.bpm.BpmProcessInstanceRespVO;
import org.flowable.engine.repository.Deployment;
import org.flowable.engine.repository.Model;
import org.flowable.engine.repository.ProcessDefinition;

import java.util.List;

/**
 * @Description : 流程定义业务实现
 * @Date : 2024/6/20
 * @Author : ChenJin
 * @Version : v1.0.0
 **/
public interface BpmProcessDefinitionService extends BaseService<BpmProcessDefinitionInfo> {

    /**
     * 查询流程定义列表信息
     * @param reqVO
     * @param pagination
     * @return
     */
    List<BpmProcessDefinitionRespVO> getBpmProcessDefinitionList(BpmProcessDefinitionReqVO reqVO, Pagination pagination);

    /**
     * 查询流程定义信息
     * @param definitionId
     * @return
     */
    BpmProcessDefinitionRespVO getBpmProcessDefinition(String definitionId);

    /**
     * 根据流程标识查询流程定义信息
     * @param key
     * @return
     */
    String getBpmProcessDefinitionIdByKey(String key);

    /**
     * 基于流程模型闯将流程定义并部署
     * @param model
     * @param modelMetaInfo
     * @param bpmnBytes
     * @param form
     * @return
     */
    String createProcessDefinition(Model model, BpmModelMetaInfoRespDTO modelMetaInfo, byte[] bpmnBytes, FormDesign form);

    /**
     * 修改流程状态
     * @param definitionId
     * @param state
     */
    void updateProcessDefinitionState(String definitionId,Integer state);

}
